﻿<UserControl x:Class="SystemModule.Views.AddNhomNguoiDungView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d" 
             MinHeight="300" MinWidth="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Infrastructure;component/Themes/CommonTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border BorderBrush="#FFBABABA" BorderThickness="1" CornerRadius="4">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White" Offset="0.05"/>
                <GradientStop Color="#FFF7F7F7"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
        </Border.Background>
        <Grid Margin="20 10 20 20">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel>
                <TextBlock Margin="40,10,0,0" Text="Tạo mới nhóm người dùng" FontWeight="Bold" Foreground="#FF7A7A7A" HorizontalAlignment="Left"  FontFamily="Segoe UI" FontSize="16" />
                <Rectangle Fill="#FFD6D6D6" Height="1" Margin="0,10 0,15" />
            </StackPanel>
            <Grid  Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="135" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <TextBlock Text="Tên nhóm:" Grid.Row="0" Style="{StaticResource TextBlockStyle}" />
                <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding TenGoi,Mode=TwoWay}" />

                <TextBlock Text="Mô tả:" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
                <TextBox Grid.Column="1" Grid.Row="1"  TextWrapping="Wrap" Text="{Binding MoTa,Mode=TwoWay}"/>

                <TextBlock Text="Cấp trường:" Grid.Row="2"  Style="{StaticResource TextBlockStyle}"/>
                <telerik:RadToggleButton Grid.Column="1" Grid.Row="2" IsChecked="{Binding Path=IsCapTruong,Mode=TwoWay}" Width="30" Height="20" Margin="0,0,0,15" />

                <StackPanel Grid.Column="1" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" Height="22" BorderBrush="#FFD6D4D4" BorderThickness="0,0,0,1"
							VerticalAlignment="Top" Background="#FFF7F7F7" HorizontalAlignment="Stretch">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock Text="Danh sách quyền"
							 HorizontalAlignment="Center" Margin="2" />
                                <Path  HorizontalAlignment="Right"
							Data="F1M513.7935,318.4341L507.1335,324.7101L512.5495,324.7101L521.4595,316.3111L512.5885,307.9531L507.1735,307.9531L513.7935,314.1921L498.7735,314.1921L498.7735,318.4341z"
							Stretch="Fill" Height="17" Width="22" 
							UseLayoutRounding="False" Margin="2" Fill="#FF2A91EB" />
                            </StackPanel>

                        </Border>
                        <telerik:RadListBox AllowDrop="True" x:Name="listBox1" Grid.Row="1"
                 ItemContainerStyle="{StaticResource DraggableListBoxItem}"
                                ItemsSource="{Binding QuyenList,Mode=TwoWay}"
                 DisplayMemberPath="TenGoi" Width="200" SelectionMode="Multiple">
                            <telerik:RadListBox.DragVisualProvider>
                                <telerik:ScreenshotDragVisualProvider />
                            </telerik:RadListBox.DragVisualProvider>
                            <telerik:RadListBox.DragDropBehavior>
                                <telerik:ListBoxDragDropBehavior />
                            </telerik:RadListBox.DragDropBehavior>
                        </telerik:RadListBox>
                    </Grid>

                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" Height="22" BorderBrush="#FFD6D4D4" BorderThickness="0,0,0,1"
							VerticalAlignment="Top" Background="#FFF7F7F7" HorizontalAlignment="Stretch">
                            <TextBlock Text="Danh sách quyền của nhóm" Margin="6 2 2 2" HorizontalAlignment="Center" />
                        </Border>
                        <telerik:RadListBox  AllowDrop="True" ItemsSource="{Binding QuyenDonViList, Mode=TwoWay}" Grid.Row="1"
                            ItemContainerStyle="{StaticResource DraggableListBoxItem}"
							Width="200"
                                 DisplayMemberPath="TenGoi" SelectionMode="Multiple">
                            <telerik:RadListBox.DragVisualProvider>
                                <telerik:ScreenshotDragVisualProvider />
                            </telerik:RadListBox.DragVisualProvider>
                            <telerik:RadListBox.DragDropBehavior>
                                <telerik:ListBoxDragDropBehavior AllowReorder="True" />
                            </telerik:RadListBox.DragDropBehavior>
                        </telerik:RadListBox>
                    </Grid>
                </StackPanel>

                <StackPanel Grid.Column="1" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
                    <telerik:RadButton Content="Lưu lại" HorizontalAlignment="Right" Name="radButton1" Width="75" Command="{Binding AddNewCommand}" />
                    <telerik:RadButton Content="Hủy bỏ" HorizontalAlignment="Right" Name="radButton2" Width="75" Command="{Binding CancelCommand}"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Border>
</UserControl>
